#!/bin/bash
#定义变量
# 传参检测
source conf/base.sh
if [ $# -ne 3 ];then
  usage
  echo -e "Usage: $0 rootpasswd netnum nethosts"
else
  exit 0
fi
#定义变量
#ssh连接密码
rootpasswd=$1
#各个机器的ip网段
netnum=$2
#各个机器的ip网络位
nethosts=$3
env=$4
#使用函数
basepath=$(cd `dirname $0`;pwd)
#环境准备

list=`rpm -qa|grep httpd|wc -l`
if [ $list -eq 0 ];then
  sh init.sh
else
   run_list=`systemctl  status httpd |grep runn|wc -l`
   [ ${run_list} -eq 0 ] && systemctl start httpd ||echo "http is OK"
fi
  case $env in
    'kubeadm')
        sh ${basepath}/install.sh  "$env" ;;
    'Binary')
        sh ${basepath}/k8s/k8s_install.sh "$env" "${container}" ;;
  esac